
exports.init = function(app) {
  
    app.get('/', function(req, res) {
        res.render('index', { title: 'Test Exxact MySQL' });
    });
//    app.get('/', function(req, res) {
//        res.render('index', { title: 'Test Exxact MySQL' });
//    });

// users CRUD
    var users = require('./models/users');
    app.get(   '/login',       users.readlogin);
    app.get(   '/users',       users.read);
    app.post(  '/users',       users.add);
    app.put(   '/users/:id',   users.update);
    app.delete('/users/:id',   users.destroy);

// parts CRUD
    var parts = require('./models/parts');
    app.get(   '/catswidget', parts.readcategorieswidget);

    app.get(   '/parts',      parts.read);
    app.post(  '/parts',      parts.add);
    app.put(   '/parts/:id',  parts.update);
    app.delete('/parts/:id',  parts.destroy);

// quotes CRUD
    var quotes = require('./models/quotes');
    app.get(   '/quote',      quotes.readQuote);
    
    app.get(   '/quotes',     quotes.read);
    app.post(  '/quotes',     quotes.add);
    app.put(   '/quotes/:id', quotes.update);
    app.delete('/quotes/:id', quotes.destroy);

// customers CRUD
    var customers = require('./models/customers');
    app.get(   '/userswidget',   customers.userswidgetread);

    app.get(   '/customers',     customers.read);
    app.post(  '/customers',     customers.add);
    app.put(   '/customers/:id', customers.update);
    app.delete('/customers/:id', customers.destroy);

};
